package com.pushworld.grc.ui;

import cn.com.infostrategy.to.common.HashVO;
import cn.com.infostrategy.to.common.WLTRemoteException;
import cn.com.infostrategy.ui.common.UIUtil;

public class GetTreeNamePath {
	private String treeid = "";

	public GetTreeNamePath() {

	}

	public String getParent(String _userid) {

		try {
			HashVO[] hash = UIUtil.getHashVoArrayByDS(null, "select id,parentid from pub_corp_dept where id='" + _userid + "'");

			if (hash.length != 0) {
				if (hash[0].getStringValue("parentid") != null) {

					treeid = hash[0].getStringValue("id") + "->" + treeid;

					getParent(hash[0].getStringValue("parentid"));
				} else {
					treeid = hash[0].getStringValue("id") + "->" + treeid;

				}
			}
		} catch (WLTRemoteException e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		}

		return treeid;
	}

}
